An enhanced jellyfish search optimizer for stochastic energy management of multi-microgrids with wind turbines, biomass and PV generation systems considering uncertainty

The energy management (EM) solution of the multi-microgrids (MMGs) is a crucial task to provide more flexibility, reliability, and economic benefits. However, the energy management (EM) of the MMGs became a complex and strenuous task with high penetration of renewable energy resources due to the stochastic nature of these resources along with the load fluctuations. In this regard, this paper aims to solve the EM problem of the MMGs with the optimal inclusion of photovoltaic (PV) systems, wind turbines (WTs), and biomass systems. In this regard, this paper proposed an enhanced Jellyfish Search Optimizer (EJSO) for solving the EM of MMGs for the 85-bus MMGS system to minimize the total cost, and the system performance improvement concurrently. The proposed algorithm is based on the Weibull Flight Motion (WFM) and the Fitness Distance Balance (FDB) mechanisms to tackle the stagnation problem of the conventional JSO technique. The performance of the EJSO is tested on standard and CEC 2019 benchmark functions and the obtained results are compared to optimization techniques. As per the obtained results, EJSO is a powerful method for solving the EM compared to other optimization method like Sand Cat Swarm Optimization (SCSO), Dandelion Optimizer (DO), Grey Wolf Optimizer (GWO), Whale Optimization Algorithm (WOA), and the standard Jellyfish Search Optimizer (JSO). The obtained results reveal that the EM solution by the suggested EJSO can reduce the cost by 44.75% while the system voltage profile and stability are enhanced by 40.8% and 10.56%, respectively.

• The energy management of a multi of multi-microgrids of the 85-bus system is solved with optimal integra- tion of a hybrid system including PV, WT, and biomass units.• The uncertainties of the system such as wind speed, load power, and solar irradiance are considered in the energy management solution.• Proposing A novel enhanced Jellyfish Search Optimizer (EJSO) for solving the EM based on (WFM) and (FDB) to tackle the stagnation problem of the conventional JSO technique.
The searching ability of the suggested EJSO is demonstrated using CEC -2019 and the traditional benchmark functions.In addition,a comprehensive comparison with SCSO, DO, GWO, the standard JSO, and WOA are achieved.
The remaining sections are listed as follows: "Problem formulation" section gives a deep clarification about the objective functions and the related constraints."Uncertainty modeling" section describes the method of representing the uncertainties in the system."Jellyfish search optimizer (JSO)" and "The enhanced jellyfish search optimizer (EJSO)" sections give the description and mathematical equations of JSO and the EJSO, respectively.The discussion of the yielded results is depicted in "Simulation results" section while the summarization of the conclusions is outlined in the final section.

Objective functions
The cost reduction The first function considered is the total cost ( TC ), which involves the cost of the energy supplied from the main grid ( C 1 ), the energy loss cost ( C 2 ), the PV cost ( C 3 ), the WT unit cost ( C 4 ), the biomass cost ( C 5 ) and, the TC can be expressed as follows: In which www.nature.com/scientificreports/where P Gr , and U Gr are the delivered power from the grid and the cost of this power per kW, respectively.
where P T_L and U L are the power loss and its cost per kW, respectively.
where C inv. PV denotes the investment cost of the PV panels, C O&M PV is its operation and maintenance cost.
where U O&M PV , U PV , P PV , P r_PV refer to operation and maintenance cost, i.e., $/kWh, the investment cost, i.e., $/ kW, the output and rated powers of the PV panels, respectively.CF is the capital recovery factor.The WT's cost can be expressed using (7).
where C inv.
WT denotes the investment cost of the PV panels, C O&M PV is its operation and maintenance cost.
where U O&M WT , U WT , P WT , P r_WT refer to the operation and maintenance cost of the WT in $/kWh, the investment cost in $/kW, and the output and rated powers of the PV panels, respectively.
The cost of the biomass system can be calculated as follows: where U O&M PV , U PV , P PV , P r_PV refer to operation and maintenance cost, i.e., $/kWh, the investment cost, i.e., $/ kW, the output and rated powers of the PV panels, respectively.CF is the capital recovery factor.The WT's cost can be expressed using (7).
where C inv.
WT denotes the investment cost of the PV panels, C O&M PV is its operation and maintenance cost.
where U O&M WT , U WT , P WT , P r_WT refer to the operation and maintenance cost of the WT in $/kWh, the investment cost in $/kW, and the output and rated powers of the WT, respectively.
The cost of the biomass system cost can be expressed using (15).
where C inv. bio denotes the investment cost of the PV panels, C O&M bio is its operation and maintenance cost.
(3) www.nature.com/scientificreports/where U O&M bio , U bio , P bio , P r_bio refer to the operation and maintenance cost of the biomass system in $/kWh , the investment cost in $/kW, and the output and rated powers of the biomass system, respectively.The recovery factor can be obtained using (18).
NP is the lifetime of the generation unit.β is the interest rate.The yielded power from the PV panels is formulated using (19)  42 : where ir std and ir denote solar irradiance and the standard deviations which equals 1000 W/m 2 .
The WT's output power can be computed as follows 43 : where, W cout , W cin and W rs represent the cut-out, cut-in, and rated wind speed respectively.

Voltage profile enhancement
Minimizing the voltage deviations will improve the performance of the system.The voltage deviation can be expressed as follows: where Nb refers to the number of buses in the MMGs.

Voltage stabilization improvement
Maximization of the voltage stability index (VSI) can improve the system performance 43 : where X n and R n represent the reactance and the resistance of the n-th line, respectively.P n and Q n are the injected real and reactive powers, respectively.The previous objective functions can be taken into consideration concurrently as depicted in (24).
Rs and Base are subscripts that refer to the system with and without PVs and WTs, respectively.a 1 , a 2 and a 3 are parameters that were selected to be 0.5, 0.25, and 0.25, respectively 44 .where the upper and the lower limits for the voltage are V min , and V max , respectively, while.P Load and Q Load denote the real and reactive power for the load respectively.I max,n is the maximum limit of the current at the n-th line.PF Min_w and PF Max_w refer to the minimum and the maximum boundaries for the power factors for the WT, while PF Min_bio and PF Max_bio are the upper and lower limitations for the biomass power factor.NT is the number of the TLs.

Equality constraints
where, P S , P PV , P Wind and P bio are the purchased powers of the utility network, the PV units, the units WTs, and the biomass, respectively.Q S , Q Wind and Q bio are the reactive powers for the main substation, the WTs, and the biomass units respectively.

Uncertainty modeling
In this work, energy management is solved by taking into consideration three stochastic parameters.The probability density functions (PDFs) are utilized for the representation uncertainties of these parameters.
The first stochastic parameter is the loading which is varied at each time discrete t and it is represented in terms of the Normal PDF based on the standard deviation ( σ PL ) of the load and its average value ( µ PL ) as follows 45,46 : The wind speeds in any area vary randomly.Weibull distribution is utilized for describing the random variation of the wind speed.Weibull distribution pdf at time discrimination t is described using two parameters including the shape ( k t ) and the scale ( c t ) factors that are driven by the standard deviation ( σ v t ) and average ( µ v t ) of the wind speed as follows 47,48 : in which The third uncertain parameter is the solar irradiance which is modeled using Beta PDF as depicted in (39).The Beta PDF is described using two parameters including the shape factors (α, β) which can be assigned using the average and the standard deviation of the irradiance ( µ t S , σ t S ) 49 : ( The means and the standard deviations of the demand, the irradiance, and the wind speed during the day ahead are presented in Figs. 1, 2, and 3, respectively. For each time segment t, The Monte Carlo simulation (MCS) method is employed to obtain 1000 scenarios of the uncertain parameters 50 .Then the scenario-based reduction (SBR) method is employed to minimize the generated scenarios to 25 scenarios 51 .Figure 4 shows the 1000 created scenarios by MCS, while Fig. 5 shows the reduced scenarios by the SBR method.

Jellyfish search optimizer (JSO)
Jellyfish live all over the world in the water, at different depths and different degrees of temperature.Where jellyfish have different types, but these types differ in size and shape.The behavior of obtaining food differs between jellyfish, as some types of jellyfish obtain food by hunting prey, and other types bring their food by using their (40)

Ocean current
Jellyfish are carried away by ocean currents, where the direction of ocean currents is expressed as (DR).This is done by calculating the average vector between jellyfish location within the ocean and the best location of jellyfish, and this can be illustrated as follows:  where, X b represents the optimal position of jellyfish in the swarm, n Pop is the jellyfish number, e c denotes the governing attraction factor, µ denotes the mean location for all jellyfish and df represents the difference between the mean place and the current optimal place of the jellyfish.Due to the common distribution of all positions, the jellyfish distance ±βσ is the distance around the average site which contains a given certain probability of all jellyfish.Hence, df can be expressed as: By substitution of df from (41) into (40).ε denotes a variable that is generated randomly from where ε ~ Bernoulli(p), with p = 1/2.
Based on the foregoing, the new position of the jellyfish can be illustrated as follows: By substituting of DR from (45) in (47).

The Jellyfish swarm
Two kinds of motions govern the movement of jellyfish in the group.The two kinds of these movements can be described as follows: Motion A is the passive movement, and the second type B is the active movement.Jellyfish begin to transfer according to the first type (A), and over time, Jellyfish follow the second type of movement (B).The jellyfish move its position can be presented as follows: where U up and L low denote the upper boundary and lower boundary of the variables, respectively.γ > 0 refers to the movement factor.
To characterize B movement, two jellyfish (j, i) have been chosen where j ≠ i.Where the movement of jellyfish can be described according to the availability of the amount of food.When the available food is high for j-th jellyfish more than that for i-th jellyfish, this jellyfish moves towards j-th jellyfish.The opposite happens if the amount of food is little, the jellyfish (i) shifts away from the j-th jellyfish.Based on the above, this movement can be described as follows: where,ST denotes the distance and can be expressed as follows: where, Ei is the direction of jellyfish motion.
Note that the mechanism of the controlled time is used to explain the kind of movement all over time.As it is not only controlling the motions of A and B within the swarm, but also controlling the motions of jellyfish towards the ocean currents, and this is what will be presented in the next section.

Mechanism of time control
The transition motion of jellyfish between all types of motions (type A, type B, ocean current) can be explained by the function of time control as expressed in (54).
where cont represents the time control function and it fluctuates from 0 to 1 which compared with a constant value C 0 where, C 0 = 0.5 .it max refers to the maximum number of iterations.In case the value of the count(t) is more than C 0 , jellyfish move with the ocean current.It is worth noting here that, the jellyfish populations are randomly generated based on a stochastic and logistic map to enhance the initial population diversity and this can be explained as follows: where ξ denotes a stochastic value that is generated at the start of the iteration in the range [0-1].µ has a fixed value where its value equals 4 and ξ ′ is a stochastic and a logistic value where ξ ′ � = {0.0,0.25, 0.75, 0.5, 1.0}.

The enhanced jellyfish search optimizer (EJSO)
The EJSO depends upon two improvement approaches including the WFM and the FDB to boost the searching capability of the presented algorithm.The WFM is conceptualized from Weibull Distribution which is based on the scale and the shape factors as explained before 53 .The motion of the jellyfish based on the Weibull flight can be described as follows: in which where rb refers to a variable that is randomly obtained from the Weibull distribution.Sign () generates a vector of -1 and + 1.The second strategy is the FDB selection method which was applied to improve several 36,[54][55][56][57] .The FDB is utilized for enriching the population's diversity.The FDB is determined by the distance between the best population and the candidates' solution.Initially, the candidate populations and the corresponding objective functions vector are represented using Eqs.( 59) and (60).
The distance between the best population and the candidate populations is calculated as follows: The fitness distance vector The populations' scores in the FDB are calculated based on the normalized distance and the normalized objective function as follows: where w represents a weight parameter in the range 0 and 1.The flow chart of the proposed algorithm is shown in Fig. 6.It should be highlighted here that the objective function is calculated after updating the position of the population to assign the best solution and keep the best-updated population because the FDB strategy is based on the distance between the population and the best solution.Thus, it is mandatory to assign the best solution after updating the populations.The pseudocode of the proposed optimizer can be described in Algorithm 1 (56)

Simulation results
The suggested EJSO is employed for the EM solution of the MMGs.The obtained results have been compared to well-known other optimizers the grey wolf optimizer GWO 58 , whale optimization algorithm (WOA) 59 , sand cat search optimizer (SCSO) 60 , dandelion optimizer (DO) 61 and Jellyfish search optimizer (JSO) 52 .The EJSO was written by the MATLAB software and the simulations were conducted on a PC with Intel i5, 4 GB RAM, 2.5 GHz CPU.

Solving of the standard and CEC-2019 benchmark functions
In this section, the suggested EJSO has been applied to the 33 benchmark functions in which F1 to F 23 are the standard functions while CEC 01 to CEC10 are the CEC 2019 functions.The parameters of optimization methods are provided in Table 2.The standard functions including the unimodal, multimodal, and fixed-dimension benchmark functions have been described in Tables 3, 4 and 5 11,62,63 , respectively while the description of CEC 2019 functions have been depicted in Table 6 64 .The results were presented over 25 run trails.

Analysis of the statistical results
Here, the performance of EJSO has been compared with GWO, DO, WOA, SCSO, and the standard JSO in terms of the worst, the best, the mean, the Wilcoxon p-values, and the standard deviation (SD) values as depicted in Table 7 for the standard and the CEC-2019 functions.The bolded values in this table refer to the best statistical results.As per the results of Table 7, the proposed EJSO algorithm has superior results in the most objective functions.However, the results are similar with SCSO for F11, JSO for F14, all optimizers for F16, all optimizers except WOA for F17, DO and JSO for CEC02, and all optimizers for CEC03.Furthermore, some optimizers give results better than the EJSO like SCSO for F10 and DO for CEC01, DO for CEC10.According to the Wilcoxon test, the p-values are less than 0.05 which verified there is a notable difference between the obtained results from the suggested algorithm and the other optimization methods.The p-values for F9, F11, and F17 are not available, this means that the results are identical for all trail runs.The computational time for SCSO, GWO, WOA, DO, JSO, and EJSO algorithms are 61.4,91.2, 150.8, 208.6, 368.3 and 1780.6 respectively.It should be highlighted here that the computational time of the proposed algorithm EJSO is slightly more than the original algorithm, this is due to the added modifications to the original algorithm.However, the EJSO needs more time, but the accuracy of the obtained results is the best.WOA 59 Population numbers 30 GWO 58 Population numbers 25 Population numbers 25 JSO 52 Population numbers 30   www.nature.com/scientificreports/

The convergence analysis
The convergence characteristics of the proposed EJSO, GWO, DO, WOA, SCSO, and the standard JSO are illustrated in Fig. 7.It is evident from the convergence characteristics, that the EJSO has good convergence for the unimodal, the multimodal, the fixed-dimension, and the CEC-2019 functions.However, the convergence of the DO is the best for CEC10.

The analysis of the boxplot
Boxplot is the best way to display the distribution of the data.The boxplots of the EJSO and the other optimizers are shown in Fig. 8.According to the boxplots, EJSO has the narrowest boxplot compared to the other optimizers for the standard and the CEC 2019 functions compared to GWO, DO, WOA, SCSO, and the standard JSO.

Application of the EJSO for EM solution
In this section, the suggested algorithm EJSO has been modified and applied in IEEE 85-bus which is divided into three micro-grids.The description of the IEEE 85-bus is listed in Table 8.The topology of IEEE 85-bus MMGs [− 5.12, 5.12] 0 2 + n j=1 u(k j , 10, 100, 4) www.nature.com/scientificreports/ is depicted in Fig. 9 and lines and bus data are provided in 60 .The studied distribution network has been divided into three microgrids and due to this division, every microgrid contains its RERs (PV, WT, and Biomass) where each network has one PV unit, one WT, and one biomass unit.The captured results by EJSO have been compared with the obtained results by the conventional JSO.For a fair comparison, the populations and the maximum iterations number have been adjusted to be 25 and 80, respectively.The purchasing energy price of the market is explained in Fig. 10 while the day ahead of the loading demand is illustrated in Fig. 11 65 .Figures 12 and 13 show the expected irradiance and wind speed respectively 66 .Three hybrid RERs are incorporated optimally in which each hybrid system consists of a PV plant, a WT, and a biomass generation unit.The system constraints as well as the costs of the PV, WT, and biomass units are listed in Table 9.
The aim of the EM is total annual cost reduction and the system's performance improvement.Table 10 lists the numerical results that have been obtained at the base case and with the inclusion of the hybrid PVs, biomass, and WTs using the JSO and the EJSO.The numerical results have been depicted in Table 10 which have been obtained by the JSO and the EJSO for the EM solution with or without RERs.In the base case, the cost, the VDs, and the VSI are 4.1642E+06 USD, 119.7076 p.u. and 1.5844E+03 p.u. respectively while the annual purchased energy and the annual energy losses are 6.4879E+06 kWh and 6.5982e+05 kWh.
As per the results in Table 10, the total costs have been reduced to 2.3726E+06 p.u. and 2.3008E+0 using the JSO and the EJSO, respectively.Likewise, the summation of VDs has been reduced from 119.7076 p.u. to 70.8672 p.u. and the voltage stability has been enhanced from1.5844E+03p.u. to 1.7517E+03 p.u.The sites of the three hybrid generation systems that were allocated by JSO are at buses 4, 49, and 69 while the assigned placements by the EJSO are at buses 7, 55, and 68.The optimal ratings of the PV units of the 1 st , the 2 nd , and the 3 rd hybrid systems that have been determined by the EJSO are 157 kW, 151 kW, and 209 kW, respectively.Likewise, the rating of the WTs in the MMGs are 450 kW, 500 kW, and 500 kW, respectively while the rating of the biomass Table 6.The CEC 2019 functions.

Function
Optimal fitness Boundaries , n = D/3 Vol:.( 1234567890) www.nature.com/scientificreports/ generation systems are 3.6448E+03 kW, 2.3768E+03 kW, and 2.7403E+03 kW, respectively.The output power of PV units has been illustrated in Fig. 14 according to the solar irradiance as well as Fig. 15 illustrates the output power of the WT units which varied due to the wind speed variation.Figure 16 displays the optimal powers of the biomass system.Figure 17, and Fig. 18 show the voltage profile of the MMG without and with RERs, respectively.From Figs. 17 and 18, it is evident that the voltage profile has been enhanced in the presence of RERs in the proposed hybrid system.As per Fig. 19, the losses were significantly decreased with the installation of the RERs into the system.

Conclusions
The key findings of this paper can be summarized as follows: firstly, a novel enhanced Jellyfish Search Optimizer (EJSO) was proposed, incorporating Feedback Disturbance Based (FDB) and Weighted Fitness Mechanism (WFM) to address the stagnation issues present in the conventional Jellyfish Search Optimizer (JSO).This enhancement aims to improve the optimization performance and convergence speed of the algorithm.Secondly, the proposed EJSO was employed for the energy management (EM) of multi-microgrids within an 85-bus system.The optimization process took into consideration various critical factors, including the total cost, voltage profile, and overall stability of the system.The optimal allocation strategy within each microgrid included a hybrid system comprising photovoltaic (PV) systems, wind turbines (WT), and biomass units, which together enhance the efficiency and sustainability of the microgrids.In practical terms, the application of the proposed EJSO for energy management with the optimal integration of hybrid Renewable Energy Sources (RESs) significantly reduced the total cost from 4.1642E+06 USD to 2.3008E+06 USD compared to the base case.Additionally, the voltage deviation (VD) was lowered from 119.7076 p.u. to 70.8672 p.u., and the voltage stability index was improved from 1.5844E+03 p.u. to 1.7517E+03 p.u.These results indicate substantial improvements in both economic and technical performance of the microgrid system.
Looking forward, future work associated with this research includes expanding the scope of energy management solutions by integrating electric vehicle (EV) stations into distribution systems.Furthermore, it suggests the optimal incorporation of various types of energy storage systems, such as compressed air energy storage (CAES) and superconducting magnetic energy storage (SMES), to further enhance the flexibility and reliability of the energy management systems.

Figure 1 .
Figure 1.The average load demands and the corresponding standard deviation.

Figure 2 .
Figure 2. The average wind speed and the corresponding standard deviation.

Figure 3 .
Figure 3.The mean solar irradiance and the corresponding standard deviation.

Figure 4 .
Figure 4.The 1000 generated scenarios by MCS of the load demand at 12:00 PM.

Figure 5 .
Figure 5.The reduced scenarios by the SBR method of the load demand at 12:00 PM.

Figure 6 .
Figure 6.The schematic flow chart of the EJSO.

Figure 10 .
Figure 10.The market energy price.

Figure 11 .
Figure 11.The expected load profile.

Figure 14 .
Figure 14.The generated powers from PVs.

Figure 15 .
Figure 15.The generated powers from WTs.

Figure 16 .
Figure 16.The output power of biomass units.

Figure 19 .
Figure 19.The active losses of the system.

Table 1 .
C 1 = 365 × U Gr × Methods of the EM solution.

Table 2 .
The parameters of the optimization methods.

Table 7 .
The statistical outcomes of the standard and CEC 2019 functions.Bold values refer to the optimal obtained values compared to other values.and the CEC-2019 benchmark suite.The comparative analysis demonstrated the superiority of EJSO in terms of solution quality and robustness.

Table 9 .
The cost parameters and the limitations.Size of PV units 0 ≤ P PV _r ≤ P Load Size of WTs 0 ≤ P wind_r ≤P Load Size of biomass unit 0 ≤ P bio_r ≤ 200kW P.F. of the WT 0.7 ≤ P.F ≤ 1 P.F. of the Biomass 0.7 ≤ P.F ≤ 1

Table 10 .
The results of the energy management solution for the MMGs.